//  排列组合
#include <iostream>

using namespace std;

#define MAX_NUMBER 10

static int gAllData[MAX_NUMBER]={0};
static int gTotal = 0;

void print(int pData[], int length)
{
	int index;

	for(index = 0; index < length; index ++)
		printf("%d", pData[index]);

	printf("\n");
}

void traverse(int pData[], int length, int number)
{
	int index;
	if(0 == length)
		return;

	for(index = 0; index < length; index++){
		gAllData[gTotal++]=pData[index];

		if(number == 1)
			print(gAllData, gTotal);
		else
			traverse(pData + (index + 1), length - (index + 1), number-1);

		gAllData[--gTotal] = 0;
	}
}

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}